<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">
    <ui:composition template="/template/DefaultTemplate.xhtml">

        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
<!--                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>-->
            </h:panelGroup>
            <h:form>
                <p:panel toggleable="true" id="salesLeadConvert" header="Convert Sales Lead To Customer">
                    <h:panelGrid columns="3">
                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_companyName}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.companyName}" title="#{bundle.ViewSalesLeadEntityTitle_companyName}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_jobTitle}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.jobTitle}" title="#{bundle.ViewSalesLeadEntityTitle_jobTitle}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_name}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.name}" title="#{bundle.ViewSalesLeadEntityTitle_name}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>

                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_password}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.password}" title="#{bundle.ViewSalesLeadEntityTitle_password}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_firstName}"/>

                        <h:outputText value="#{salesLeadEntityController.selected.firstName}" title="#{bundle.ViewSalesLeadEntityTitle_firstName}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_lastName}"/>

                        <h:outputText value="#{salesLeadEntityController.selected.lastName}" title="#{bundle.ViewSalesLeadEntityTitle_lastName}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_title}"/>

                        <h:outputText value="#{salesLeadEntityController.selected.title}" title="#{bundle.ViewSalesLeadEntityTitle_title}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>



                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_id}"/>

                        <h:outputText value="#{salesLeadEntityController.selected.id}" title="#{bundle.ViewSalesLeadEntityTitle_id}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>

                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_createdAt}"/>


                        <h:outputText value="#{salesLeadEntityController.selected.createdAt}" title="#{bundle.ViewSalesLeadEntityTitle_createdAt}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>

                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_createdBy}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.createdBy}" title="#{bundle.ViewSalesLeadEntityTitle_createdBy}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>

                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_lastModifiedAt}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.lastModifiedAt}" title="#{bundle.ViewSalesLeadEntityTitle_lastModifiedAt}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>

                        <h:outputText value="#{bundle.ViewSalesLeadEntityLabel_lastModifiedBy}"/>
                        <h:outputText value="#{salesLeadEntityController.selected.lastModifiedBy}" title="#{bundle.ViewSalesLeadEntityTitle_lastModifiedBy}"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>

                        <h:outputLabel value="#{bundle.ConvertSalesLeadEntityLabel_customerExecutive}" for="customerExecutive" />
                        <h:selectOneMenu id="customerExecutive" value="#{customerEntityController.selected.customerExecutive}" title="#{bundle.ConvertSalesLeadEntityTitle_customerExecutive}" >
                            <f:selectItems value="#{systemUserEntityController.salesExecutiveAvailableSelectOne}"/>
                            <f:validator validatorId="macTeam.SystemUserSelectOneMenuValidator" />
                        </h:selectOneMenu>
                        <h:message styleClass="errorMsg" for= "customerExecutive"/>

                    </h:panelGrid>    
                </p:panel>
                <br/>
                <p:panel toggleable="true" id="salesLeadContact" header="Contact Details">
                    <h:panelGrid columns="3">
                        <h:outputText value="Email: "/>
                        <h:outputText value="#{salesLeadEntityController.selected.contact.email}" title="Email"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                        <h:outputText value="Contact Number: "/>
                        <h:outputText value="#{salesLeadEntityController.selected.contact.contactNumber}" title="ContactNumber"/>
                        <h:message styleClass="errorMsg" for= "ContactNumber"/>
                    </h:panelGrid>
                    <br />
                </p:panel>
                
                <br />
                     <ui:include src="/entities/addressEntity/ListAddress.xhtml"/>
                <br />
                <p:commandButton ajax="false" action="#{customerEntityController.convertToCustomer}" value="#{bundle.ConvertViewSalesLeadEntityConvert}" rendered="#{loginBacking.convertSalesLead}"/>

            </h:form>
        </ui:define>
    </ui:composition>

</html>
